package priv.mill.server.impl;
import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import priv.mill.dao.mapper.RoleMapper;
import priv.mill.entry.Role;
import priv.mill.server.RoleService;

@Component
public class RoleServiceImpl implements RoleService{

	private static final Logger logger = Logger
			.getLogger(RoleServiceImpl.class);

	@Autowired
	private RoleMapper roleMapper;
	
	@Override
	public Role getRoleById(Integer roleId) {
		return roleMapper.getRoleById(roleId);
	}

	@Override
	public Role getRoleByEntry(Role role) {
		return roleMapper.getRoleByEntry(role);
	}

	@Override
	public List<Role> getRolesByPage(Role role) {
		return roleMapper.getRolesByPage(role);
	}

	@Override
	public int updateRole(Role role) {
		return roleMapper.updateRole(role);
	}

	@Override
	public int insertRole(Role role) {
		return roleMapper.insertRole(role);
	}

	@Override
	public int deleteRole(Integer roleId) {
		return roleMapper.deleteRole(roleId);
	}
}
